# frozen_string_literal: true

source "https://rubygems.org"

if ENV.fetch("HOMEBREW_DEVELOPER", "").empty? || ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", "").empty?
  ruby "~> 2.6.0"
else
  ruby ">= 2.6.0"
end

# disallowed gems (should not be used)
# * nokogiri - use rexml instead for XML parsing

# installed gems (should all be require: false)
gem "bootsnap", require: false
gem "byebug", require: false
gem "json_schemer", require: false
gem "minitest", require: false
gem "parallel_tests", require: false
gem "pry", require: false
gem "ronn", require: false
gem "rspec", require: false
gem "rspec-github", require: false
gem "rspec-its", require: false
gem "rspec_junit_formatter", require: false
gem "rspec-retry", require: false
gem "rspec-sorbet", require: false
gem "rubocop", require: false
gem "rubocop-ast", require: false
gem "simplecov", require: false
gem "simplecov-cobertura", require: false
gem "warning", require: false

group :sorbet, optional: true do
  gem "parlour", require: false
  gem "sorbet-static-and-runtime", require: false
  gem "spoom", require: false
  gem "tapioca", require: false
end

group :prof, optional: true do
  # NOTE: ruby-prof v1.4.3 is the last version that supports Ruby 2.6.x
  # TODO: remove explicit version when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
  gem "ruby-prof", "1.4.3", require: false
  gem "stackprof", require: false
end

# vendored gems
gem "activesupport"
gem "addressable"
gem "concurrent-ruby"
gem "patchelf"
gem "plist"
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "rubocop-sorbet"
gem "ruby-macho"
gem "sorbet-runtime"

# TODO: remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
install_if -> { RUBY_VERSION < "2.7" } do
  gem "did_you_mean"
end
